<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% gcp_location = "#{external_attribute(pwd, 'gcp_location', doc_generation)}" -%>
describe google_compute_regions(project: <%= gcp_project_id -%>) do
  its('count') { should be >= 1 }
  its('region_names') { should include "#{gcp_location}" }
  its('region_statuses') { should_not include "DOWN" }
  its('region_ids') { should include "1290" }
end

<% if doc_generation -%>
```
  ### Use this InSpec resource to enumerate IDs then test in-depth using `google_compute_region`
```
  google_compute_regions(project: 'chef-inspec-gcp').region_names.each do |region_name|
    describe google_compute_region(project: 'chef-inspec-gcp',  region: region_name) do
      it { should be_up }
    end
  end
```

  ### Test that there are more than a specified number of regions available for the project
```
  describe google_compute_regions(project: 'chef-inspec-gcp') do
    its('count') { should be >= 10}
  end
```
  ### Test that an expected region is available for the project
```
  describe google_compute_regions(project: 'chef-inspec-gcp') do
    its('region_names') { should include 'europe-west2' }
  end
```
  ### Test whether any regions are in status "DOWN"
```
  describe google_compute_regions(project: 'chef-inspec-gcp') do
    its('region_statuses') { should_not include "DOWN" }
  end
```

  ### Test that a subset of all regions matching "europe*" are "UP"
```
  google_compute_regions(project: gcp_project_id).where(region_name: /^europe/).region_names.each do |region_name|
    describe google_compute_region(project: 'chef-inspec-gcp',  region: region_name) do
      it { should be_up }
    end
  end
<% end -%>